<?php

class Template{

    static function getPath($path)
    {
        $curDir = getcwd();
        $p = explode("/", $path);
        return $curDir."/../controllers/".$p[0]."/views/". $p[1] .".php";
    }


    static function render_template($path, array $args)
    {
        extract($args);
        ob_start();
        require self::getPath($path);
        $html = ob_get_clean();

        return $html;
    }

    static function render_partial($path, array $args)
    {
        extract($args);
        require self::getPath($path);
    }

}
?>
